package defense.graphics;

import defense.physics.Vec2f;

public class Explosion extends ParticleEffect {

	public Explosion(Vec2f pos) {
		final int particles = 25;
		for (int i = 0; i < particles; i++) {
			float angle = (float) (i * Math.PI * 2.0f / particles);

			Vec2f dir = new Vec2f((float) Math.cos(angle),
					(float) Math.sin(angle));
			dir.mult((float) (Math.random() * 3.0 + 1.0));
			Particle p = new Particle(pos, dir, 10);
			addParticle(p);
		}
	}
}
